
<ion-header>

  <ion-navbar>
    <ion-title>新增笔记</ion-title>
  </ion-navbar>

</ion-header>


<ion-content padding>
  <form [formGroup]="formGroup" (ngSubmit)="saveNote(formGroup.value)">
    <ion-item>
      <ion-label>日期</ion-label>
      <ion-datetime displayFormat="MM/DD/YYYY" formControlName="date"></ion-datetime>
    </ion-item>
    <ion-item>
      <ion-label>标题</ion-label>
      <ion-input type="text" name="title" formControlName="title" required></ion-input>
      <div class="alert" *ngIf="!formGroup.controls['title'].valid && formGroup.controls['title'].touched">{{titleAlert}}</div>
    </ion-item>
    <ion-item>
      <ion-label>笔记</ion-label>
      <ion-input type="text" name="content" formControlName="content" required></ion-input>
      <div class="alert" *ngIf="!formGroup.controls['content'].valid && formGroup.controls['content'].touched">{{titleAlert}}</div>
    </ion-item>
    <button ion-button type="submit" [disabled]="!formGroup.valid">保存</button>
  </form>
</ion-content>
